package com.example.demo.mapper;

import com.example.demo.entity.Articleinfo;
import com.example.demo.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int getArtCountByUid(@Param("uid") Integer uid);

    List<Articleinfo> getMyList(@Param("uid") Integer uid);

    void addUpvote(@Param("blog_id") Integer blog_id);

    int del(@Param("id") Integer id,@Param("uid") Integer uid);

    Articleinfo getDetail(@Param("id")Integer id);

    int incrRCount(@Param("id") Integer id);

    List<Comment> comments(@Param("blog_id") Integer blog_id);

    int addComment(@Param("username") String username,
                   @Param("contents") String contents,
                   @Param("blog_id") Integer blog_id);

    int add(Articleinfo articleinfo);

    int draft(Articleinfo articleinfo);

    int update(Articleinfo articleinfo);

    int updateState(Integer id);

    List<Articleinfo> getListByPage(@Param("psize")Integer psize,
                                    @Param("offsize")Integer offsize);



    int getCount();
}
